home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / xview / xhist / xhist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-17  |  3.0 KB  |  135 lines

  1.  
  2. /* xhist.h  */
  3.  
  4. #include <hipl_format.h>
  5.  
  6. #include <stdio.h>
  7. #include <sys/param.h>
  8. #include <sys/types.h>
  9. #include <math.h>
  10.  
  11. #include <xview/xview.h>
  12. #include <xview/panel.h>
  13. #include <X11/Xlib.h>
  14.  
  15. #include <X11/X.h>
  16. #include <xview/frame.h>
  17. #include <xview/canvas.h>
  18. #include <xview/font.h>
  19. #include <xview/xv_xrect.h>
  20. #include "xhist_ui.h"
  21.  
  22. #define Calloc(x,y) (y *)calloc((unsigned)(x), sizeof(y))
  23. #define Fread(a,b,c,d) fread((char *)(a), b, (int)(c), d)
  24. #define Cfree(x,y,z) cfree((char *)(x), (unsigned)(y), z)
  25.  
  26. /* global image stuff */
  27.  
  28. extern int       pix_format;           /* byte, short, int, float  */
  29.  
  30. extern int       size;             /* size of image */
  31.  
  32. extern int b_hist[256];  /*  byte histogram    */
  33.  
  34. extern float val_min;  /*  for byte,  short      */
  35. extern float val_Max;
  36. extern int occ_Max;
  37.  
  38. extern int *s_hist;  /*  [-32768:32767]  short histogram       */
  39.  
  40. extern int n_of_dv;  /*  number of different values            */
  41.  
  42. extern int cur_nofdv;  /*  number of different values on the current graph  */
  43.  
  44. typedef struct ihtype {
  45.     int pv;   /*  pixel value       */
  46.     int occ;  /*  occurrence        */
  47.     struct ihtype *next;
  48.     } Ihtype;  /*  int hist type    */
  49.  
  50. typedef struct fhtype {
  51.     float pv;   /*  pixel value     */
  52.     int occ;  /*  occurrence        */
  53.     struct fhtype *next;
  54.     } Fhtype;  /*  float hist type  */
  55.  
  56. extern Ihtype *i_hist;  /*  int histogram    */
  57.  
  58. extern Fhtype *f_hist;  /*  float histogram  */
  59.  
  60.  
  61. extern char hint_s[30][50];  /*  hint string    */
  62.  
  63. extern int Top;
  64.  
  65. extern int Bottom;
  66.  
  67. extern int histo_graph[1000];  /*  histogram graph     */
  68.  
  69. extern int histo_va[1000];  /*  current histo_graph value  */
  70.  
  71. extern float fhisto_va[1000];  /*  current histo_graph value  */
  72.  
  73. extern int range;  /*  range of indices of histo_graph to show   */
  74.  
  75. #define color_White  WhitePixel(display, DefaultScreen(display))
  76. #define color_Black  BlackPixel(display, DefaultScreen(display))
  77.  
  78. int FRM_WD; /*  frame width             */
  79.  
  80. int FRM_HT; /*  frame height            */
  81.  
  82. float HGT;  /*  height of histogram               */
  83.  
  84. int TXTHT = 16;        /* height of text in canvas */
  85.  
  86. int TXTWD = 18;  /*  left blank -FH     */
  87.  
  88. float y_unit;
  89.  
  90. int CV_HT = 415;  /*  canvas height          */
  91.  
  92. int move_j = -1;
  93. int NewLeft = -1;
  94. int NewRight = -1;
  95. int NewTop = -1;
  96. int NewBottom = -1;
  97.  
  98. extern char *cur_fname;  /*  current file name      */
  99.  
  100. extern int paint;  /*   0:      fisrt picture of this image
  101.             1:  not fisrt picture of this image    */
  102.  
  103. extern int y_label[10];
  104.  
  105. extern int end_y;  /*  end of y_label[]        */
  106.  
  107. extern int x_label[20];
  108.  
  109. extern int end_x;  /*  end of x_label[]        */
  110.  
  111. extern float fx_label[20];
  112.  
  113. extern float pv_diff;  /*  pixel value difference      */
  114.  
  115. extern int occ_diff; /*  occurrence difference      */
  116.  
  117. int x_cover_l[20];
  118.  
  119. int x_cover_r[20];
  120.  
  121. int end_xc;  /*  end of x_cover_l[] and x_cover_r[]    */
  122.  
  123. int y_cover_s[20];
  124.  
  125. int y_cover_g[20];
  126.  
  127. int end_yc;  /*  end of y_cover_s[] and y_cover_g[]    */
  128.  
  129. extern int x_pos[20];
  130.  
  131. extern int y_pos[20];
  132.  
  133. extern int cur_size;  /*  size of current graph        */
  134.  
  135.